package com.ruijie.mvc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.ruijie.mvc.services.RestHelloServices;
import com.ruijie.orm.entity.User;

@RestController
@RequestMapping(value = "/rest")
public class RestHelloController {

	@Autowired
	RestHelloServices service;

	@RequestMapping(method = RequestMethod.GET, value = "/get")
	public User getUser(@RequestParam("userName") String userName) {
		return service.getUser(userName);
	}

	@RequestMapping(method = RequestMethod.GET, value = "/remove")
	public String removrUser(@RequestParam("userName") String userName) {
		return service.removeUser(userName);
	}
}
